package com.daigoudao.web.model;

import java.util.Date;
import java.util.List;

import com.daigoudao.util.StringUtils;

@SuppressWarnings("serial")
public class ShortMessage extends BasePageModel {

	/**
	 * 主消息id
	 */
	private int mainSmid;
	private int smid;
	private int sender;
	private int receiver;

	private String title;
	private String content;
	private String allContent;
	private int read = -1;
	private int[] smids;
	private Date createtime;
	private int wantid;
	private int orderid;
	private String type;
	private int replyid;
	private int replyTag = -1;
	private String senderName;
	private Date updateTime;

	private String email;

	/**
	 * 回复消息
	 */
	private List<ShortMessage> replyMessages;

	public int[] getSmids() {
		return smids;
	}

	public void setSmids(int[] smids) {
		this.smids = smids;
	}

	public String getAllContent() {
		return allContent;
	}

	public void setAllContent(String allContent) {
		this.allContent = allContent;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Date getCreatetime() {
		return createtime;
	}

	public void setCreatetime(Date createtime) {
		this.createtime = createtime;
	}

	public String getCreateDateStr() {
		return StringUtils.formatDate(createtime, "yyyy-MM-dd HH:mm:ss");
	}

	public String getSenderName() {
		return senderName;
	}

	public void setSenderName(String senderName) {
		this.senderName = senderName;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public int getReplyid() {
		return replyid;
	}

	public void setReplyid(int replyid) {
		this.replyid = replyid;
	}

	public int getSmid() {
		return smid;
	}

	public void setSmid(int smid) {
		this.smid = smid;
	}

	public int getSender() {
		return sender;
	}

	public void setSender(int sender) {
		this.sender = sender;
	}

	public int getReceiver() {
		return receiver;
	}

	public void setReceiver(int receiver) {
		this.receiver = receiver;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
		if (content != null) {
			if (content.length() > 10) {
				title = content.substring(0, 10) + "...";
			} else {
				title = content;
			}
		}

	}

	public int getWantid() {
		return wantid;
	}

	public void setWantid(int wantid) {
		this.wantid = wantid;
	}

	public int getOrderid() {
		return orderid;
	}

	public void setOrderid(int orderid) {
		this.orderid = orderid;
	}

	public int getRead() {
		return read;
	}

	public void setRead(int read) {
		this.read = read;
	}

	public String getTitle() {
		return title;
	}

	public int getReplyTag() {
		return replyTag;
	}

	public void setReplyTag(int replyTag) {
		this.replyTag = replyTag;
	}

	public void setReplyMessages(List<ShortMessage> replyMessages) {
		this.replyMessages = replyMessages;
	}

	public List<ShortMessage> getReplyMessages() {
		return replyMessages;
	}

	public void setMainSmid(int mainSmid) {
		this.mainSmid = mainSmid;
	}

	public int getMainSmid() {
		return mainSmid;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

}
